import request from "@/utils/request.js";

/**
 * 新人/折扣活动操作
 * @param {Object} data
 */
export function newUserActivityOperate(data) {
  return request({
    url: "/jy-marketing/mgmt/activity/operate",
    method: "post",
    data
  });
}
/**
 * 新人/折扣优惠分页
 */
export function newUserActivityPage(data) {
  return request({
    url: "/jy-marketing/mgmt/activity/discountPage",
    method: "post",
    noCancelToken: true,
    data
  });
}
/**
 * 我的活动分页
 */
export function myActivityPage(data) {
  return request({
    url: "/jy-marketing/mgmt/activity/myActivityPage",
    method: "post",
    data
  });
}
/**
 * 折扣/店铺活动终止-删除
 * @param {boolean} opsType  true：终止 false：删除
 * @param {string} activityId 活动id
 */
export function deleteActivity(params) {
  return request({
    url: "/jy-marketing/mgmt/activity/activityAbortOrDel",
    method: "delete",
    params
  });
}
/**
 * 新人特惠活动详情
 * @param {Object} data 活动id
 */
export function getNewUserActivityDetail(data) {
  return request({
    url: "/jy-marketing/mgmt/activity/activityDetail",
    method: "post",
    data
  });
}

/**
 * 获取已经配置过新人优惠的店铺
 * @param {Object} data
 */
export function getNewUserActivityShop(data) {
  return request({
    url: "/jy-marketing/mgmt/activityTimeConfig/check",
    method: "post",
    data
  });
}